const db = uniCloud.database();
module.exports = async function(options = {}) {
	const { keys } = options;
	const token = this.getUniIdToken();
	if (!token || !keys) {
		throw new Error('非法访问');
	}
	let updateData = {};
	keys.forEach(item => {
		updateData[item] = db.command.remove();
	})
	await db.collection('uni-id-users').where({ token }).update({
		setting: updateData
	})
	return {
		code: 0,
		msg: '恢复默认成功'
	}
}